package com.ttdev.mmms.service.impl;

import com.ttdev.mmms.entity.Activity;
import com.ttdev.mmms.repository.ActivityRepository;
import com.ttdev.mmms.service.ActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActivityServiceImpl implements ActivityService {
    @Autowired
    private ActivityRepository activityRepository;

    // 查询活动
    public List<Activity> findAll(){
        return activityRepository.findAll();
    }
    public List<Activity> findAll1(){
        return activityRepository.findAll1();
    }

    @Override
    public List<Activity> queryMember(Integer id) {
        List<Activity> list = activityRepository.queryMember(id);
        return list;
    }

    @Override
    public int update(Activity activity) {
        int i = activityRepository.update(activity);
        return i;
    }

    @Override
    public int delete(Integer id) {
        int i = activityRepository.delete(id);
        return i;
    }

    @Override
    public int add(Activity activity) {
        int i = activityRepository.add(activity);
        return i;    }

}
